package Singleton;

/**
 * @ProjectName: 23种设计模式
 * @Package: Singleton
 * @ClassName: Mgr02
 * @Author: renhan
 * @Description:
 * @Date: 2020/11/10 15:39
 * @Version: 1.0
 */
public class Mgr02 {
    private static final Mgr02 INSTANCE;
    static {
        INSTANCE = new Mgr02();
    }
    private Mgr02(){};
    public static Mgr02 getInstance(){
        return INSTANCE;
    }
    public  void m() {System.out.println("m");}

    public static  void main(String[] args){
        Mgr02 m1 = Mgr02.getInstance();
        Mgr02 m2 = Mgr02.getInstance();
        System.out.println(m1 == m2);
    }
}
